package com.mux.springbootjsp.comtroller;

import java.util.Date;
import java.util.Map;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class InfoController {
	@Value("${application.message:Hello World}")
	private String message = "Hello World";

	
	 public InfoController() {
		System.out.println("init InfoController");
	}
	 
	@RequestMapping("/get")
	@ResponseBody
	public String get(){
		return "get";
	}

	@RequestMapping("/index")
	public String index(Map<String, Object> model) {
		System.out.println("index mothod");
		model.put("time", new Date());
		model.put("message",this.message);
	    return "index";
	}


}
